﻿package soundCom 
{
	import flash.events.EventDispatcher;
	import media.soundItem;
	import flash.events.Event;
	import net.netvars;
	import media.fixSound;
	/**
	 * ...
	 * @author keys_star@163.com
	 */
	public class inLine extends EventDispatcher
	{
		private var soundArr:Array;
		private var si:soundItem;
		public function inLine() 
		{
			
		}
		public function init() {
			var s0:Array = [7];
			var n = Number(netvars.getVar("ID"));//电话
			var s1 = fixSound.getIDCardSound(n);
			s0 = s0.concat(s1);
			s0.push(8);
			s0.push(9);
			s0.push(10);
			soundArr = new Array;
			soundArr.push(s0);
		}
		public function play() {
			if(soundArr.length>0){
				var a = soundArr[0];
				si = new soundItem;
				si.addEventListener(Event.SOUND_COMPLETE, scom);
				si.soundArr = a;
				si.play();
				soundArr.shift();
			}else {
				init();
			}
		}
		private function scom(e:Event) {
			play();
		}
		private function stop() {
			si.stop();
		}
	}
	
}